/**
 * Created by Charlotte on 2017/9/5.
 */

$(document).ready(function () {
    $("#inputvideo").fileinput({
        theme:"fa",
        language:"zh",
        uploadUrl:"/person/uploadvideo.do",
        uploadAsync:"true",
        enctype: 'multipart/form-data',
        maxFileSize: 9999999,
        allowedFileExtensions : ['flv', 'mp4','avi'],
        maxFileCount:1,
        autoReplace:"true"
    }).on('fileuploaded',function (event,data,previewID,index) {
        var response=data.response;
        console.log(response);
        var json = {username:$username,videosrc:response,videoname:$('#videoname').val()};
        $.ajax({
            url:url+'person/addvideo.do',
            data:json,
            type:"get",
            datatype:"json",
            success:function (data) {
                if(data=="success")
                {
                    $('#AlertSuccess').removeClass('hide');
                }
            }
        })


    })
})